package prototype;

/**
 * @author： pang-yun
 * @date： 2021-10-22 01:49
 * 功能目的 ：用于
 */

public class Client {
    public static void main(String[] args) {
        // 传统方式克隆羊
        Sleep sleep = new Sleep("tom", 1, "white","man",
                new Sleep("jack",2,"black","man",null));
        System.out.println(sleep);
        Sleep clone = sleep.clone();
        Sleep cloneA = sleep.clone();
        //引用数据对象浅拷贝  hashcode 没有改变
        System.out.println("clone: "+clone+ "hashcode"+clone.hashCode());
        System.out.println("clone: "+cloneA+ "hashcode"+cloneA.hashCode());
    }
}
